package com.example.onlinemarket.model;

import static com.example.onlinemarket.Application.download;
import static com.example.onlinemarket.util.FileUtil.externalFilesDir;

public class OrderedGood {
    private Integer goodId;
    private String goodName;
    private Double sellPrice;
    private String note;
    private Integer goodNum;
    private String localPath;
    private String imgPath;

    //从服务器获取商品照片
    public void getGoodImg(){
        download(imgPath);
        localPath = externalFilesDir+imgPath;
    }

    public String getLocalPath() {
        return localPath;
    }

    public void setLocalPath(String localPath) {
        this.localPath = localPath;
    }

    public String getImgPath() {
        return imgPath;
    }

    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }

    @Override
    public String toString() {
        return "OrderedGood{" +
                "goodId=" + goodId +
                ", goodName='" + goodName + '\'' +
                ", sellPrice=" + sellPrice +
                ", note='" + note + '\'' +
                ", goodNum=" + goodNum +
                '}';
    }

    public Integer getGoodId() {
        return goodId;
    }

    public void setGoodId(Integer goodId) {
        this.goodId = goodId;
    }

    public String getGoodName() {
        return goodName;
    }

    public void setGoodName(String goodName) {
        this.goodName = goodName;
    }

    public Double getSellPrice() {
        return sellPrice;
    }

    public void setSellPrice(Double sellPrice) {
        this.sellPrice = sellPrice;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Integer getGoodNum() {
        return goodNum;
    }

    public void setGoodNum(Integer goodNum) {
        this.goodNum = goodNum;
    }
}
